package de.baumann.browser.present.duobao

import de.baumann.browser.api.OdinObserver
import de.baumann.browser.api.net.vo.duobao.JiangPin
import de.baumann.browser.base.BasePresenter
import de.baumann.browser.iview.duobao.IWuLiuView
import de.baumann.browser.model.wuliu

class IWuLiuPresenter : BasePresenter<IWuLiuView>() {

    fun getWuLiu() {
        wuliu(view!!.id)
                .subscribe(object : OdinObserver<JiangPin>(view) {
                    override fun onSuccess(data: JiangPin?) {
                        if (data==null){
                            return
                        }

                        view?.setSHR(data.name)
                        view?.setAddress(data.address+data.addressInfo)
                        view?.setJPTP(data.logisticsImage)
                        view?.setDanHao(data.logisticsNumber)
                        view?.setWuLiu(data.list)
                        view?.setWuLiuMC(data.expName)

                    }
                })
    }

}